/**
 * Created by mengxiaxia on 2017/2/12.
 */
var zhttApp=angular.module('zhttApp', ['ngRoute'])
    .controller('HomeController', function ($scope, $route) { $scope.$route = $route;})
    .controller('2Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/2/"+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('5Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/5/"+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('6Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/6/"+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('7Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/7/"+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('8Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/8."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('9Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/9."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('10Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/10."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('11Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/11."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('12Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/12."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('13Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/13."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('14Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/14."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('15Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/15."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('16Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/16."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('17Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/17."+$scope.id +"");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('21Controller', function ($scope, $route) { $scope.$route = $route;})
    .controller('21Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/20."+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('22Controller', function ($scope, $route) {
        $scope.$route = $route;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/22.html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('22Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/22动画/22."+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('23ontroller', function ($scope, $route) {
        $scope.$route = $route;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/23.html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('23Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/23/23."+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('25ontroller', function ($scope, $route) {
        $scope.$route = $route;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/25/25.html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('25Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/25/25."+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('28Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/28/28."+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('26Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/26/26."+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .controller('29Controllers', function ($scope, $routeParams,$rootScope,$http) {
        $scope.id = $routeParams.id;
        $("iframe").attr("src","demo02-quan-wei-zhi-nan/29/29."+$scope.id +".html");
        $http.get($("iframe").attr("src")).then(function (data) {
            $rootScope.message=data.data;
        });
    })
    .config(function ($routeProvider) {
        $routeProvider.
        when('/home', {
            templateUrl: 'home.html',
            controller: 'HomeController'
        }).
        when('/2数据绑定/2/:id', {
            templateUrl: '2.html',
            controller: '2Controllers'
        }).
        when('/5/:id', {
            templateUrl: '5.html',
            controller: '5Controllers'
        }).
        when('/6/:id', {
            templateUrl: '6.html',
            controller: '6Controllers'
        }).
        when('/7/:id', {
            templateUrl: '7.html',
            controller: '7Controllers'
        }).
        when('/8/:id', {
            templateUrl: '8.html',
            controller: '8Controllers'
        }).
        when('/9/:id', {
            templateUrl: '9.html',
            controller: '9Controllers'
        }).
        when('/10/:id', {
            templateUrl: '10.html',
            controller: '10Controllers'
        }).
        when('/11/:id', {
            templateUrl: '11.html',
            controller: '11Controllers'
        }).
        when('/12/:id', {
            templateUrl: '12.html',
            controller: '12Controllers'
        }).
        when('/13/:id', {
            templateUrl: '13.html',
            controller: '13Controllers'
        }).
        when('/14/:id', {
            templateUrl: '14.html',
            controller: '14Controllers'
        }).
        when('/15/:id', {
            templateUrl: '15.html',
            controller: '15Controllers'
        }).
        when('/16/:id', {
            templateUrl: '16.html',
            controller: '16Controllers'
        }).
        when('/17/:id', {
            templateUrl: '17.html',
            controller: '17Controllers'
        }).
        when('/20事件', {
            templateUrl: '20.html',
            controller: '20Controller'
        }).
        when('/21架构', {
            templateUrl: '21.html',
            controller: '21Controller'
        }).
        when('/21架构/:id', {
            templateUrl: '21.html',
            controller: '21Controllers'
        }).
        when('/22', {
            templateUrl: '22.html',
            controller: '22Controller'
        }).
        when('/22/:id', {
            templateUrl: '22.html',
            controller: '22Controllers'
        }).
        when('/23', {
            templateUrl: '23.html',
            controller: '23Controller'
        }).
        when('/23/:id', {
            templateUrl: '23.html',
            controller: '23Controllers'
        }).
        when('/25', {
            templateUrl: '25.html',
            controller: '25Controller'
        }).
        when('/25/:id', {
            templateUrl: '25.html',
            controller: '25Controllers'
        }).
        when('/26/:id', {
            templateUrl: '26.html',
            controller: '26Controllers'
        }).
        when('/28/:id', {
            templateUrl: '28.html',
            controller: '28Controllers'
        }).
        when('/29/:id', {
            templateUrl: '29.html',
            controller: '29Controllers'
        }).
        when('', {
            redirectTo: '/home'
        }).
        otherwise({
            redirectTo: '/home'
        });
    });
$(function () {
    var ifm=$("iframe");
    ifm.load(function () {
        ifm.height($(ifm[0].contentDocument).height());
    });
});

zhttApp.run(function ($rootScope,$http) {
    $http.get($("iframe").attr("src")).then(function (data) {
        $rootScope.message=data.data;
    });
});